1. Field of the Invention
The present invention relates generally to dual-port memory controllers, and more particularly to a dual-port memory controller which can adjust data access timing of a processor.
2. Description of the Related Art
Generally, a dual-port memory controller is a device which includes a readable/writable memory (Random Access Memory), and controls operations of inputting/outputting data to read/write data in response to requests from external processors.
An example in which two processors are connected to a dual-port memory controller to perform data access operations for a memory area is described with reference to FIG. 1.
As shown in FIG. 1, a conventional dual-port memory controller 1 comprises data controllers 10 and 10a to individually input/output data to/from a plurality of processors, address decoders 20 and 20a to individually decode addresses outputted from the processors, a memory 30 to store data, and a memory controller 40 to control operations of accessing data in a predetermined memory area by the processors. Further, the conventional dual-port memory controller 1 comprises enable generators 3 and 3a, and arbitrators 5 and 5a, respectively, corresponding to the processors. The enable generators 3 and 3a receive output enable signals OE-L and OE-R, chip select signals CS-L and CS-R and read/write signals R/W-L and R/W-R, respectively, from the processors. The arbitrators 5 and 5a receive the chip select signals CS-L and CS-R and read/write signals R/W-L and R/W-R, respectively, from the processors.
The dual-port memory controller 1 can accept data access requests from two processors. The two processors output address signals ADDR-L and ADDR-R, the chip select signals CS-L and CS-R and the read/write signals R/W-L and R/W-R, respectively, to the memory controller 40 so as to access a memory area of a specific address in the memory 30. In this case, the memory controller 40 determines which area of the memory is selected and whether an operation is about reading or writing according to inputted signals. If the operation is about writing, the memory controller 40 writes data inputted through signals DATA-L and DATA-R, respectively, in a selected memory area of the memory 30; while if the operation is about reading, the memory controller 40 reads data from a selected memory area of the memory 30 and outputs the data to a corresponding processor through data signals DATA-L and DATA-R, respectively.
If the processors request different memory areas in the memory 30, the dual-port memory controller 1 can simultaneously accept different requests and perform data access operations.
However, if the processors simultaneously request the dual-port memory controller 1 to access the memory area of a same address, a collision between signals in a signal line occurs, thus causing a malfunction producing damage to the data.
The memory controller 40 first processes a data access operation for any one processor. After the data access operation is finished, the memory controller 40 sends a signal indicating that it can accept data access requests from the other processor. Then, according to the signal, the other processor can execute data access to a corresponding memory area.
In other words, if requests to access the same memory area are almost simultaneously received from two processors, the memory controller 40 first executes a request received earlier. At this time, the memory controller 40 outputs a request disapproval signal BUSY-L or BUSY-R indicating that the memory controller 40 cannot accept the other request because a prior processor is accessing the memory area of a corresponding address, thus allowing the other processor to access the corresponding memory area later.
If simultaneous data access requests for the same memory area are received from two processors, the memory controller 40 arbitrarily designates any of two requests and processes the designated request first. At this time, the memory controller 40 sends the request disapproval signal BUSY-L or BUSY-R indicating that the memory controller 40 cannot accept the request to a processor whose request is not processed, thus instructing the processor to access the corresponding memory area again next time.
FIGS. 2A through 2F are timing diagrams showing each signal when two processors request access to the same memory area according to the conventional dual-port memory controller, and show a case where an L-side processor requests access to the memory prior to an R-side processor. At this time, the request of the L-side processor is “writing data in a memory area of an address 1” while the request of the R-side processor is “reading data from a memory area of an address 1”.
Since the “address 1” corresponding to a memory area of the memory 30 is requested by both the L-side and R-side processors at the same time, the memory controller 40 cannot simultaneously accept requests from the L-side and R-side processors. Therefore, the memory controller 40, for example, accepts the request from the L-side processor prior to an R-side processor and the L-side processor requests to perform a write operation. At this time, the memory controller 40 outputs a logic “0” signal indicating that the memory controller 40 cannot accept a data access request from the R-side processor, as an activated request disapproval signal BUSY-R to the R-side processor.
Then, the memory controller 40 outputs a logic “1” signal, as an inactivated request disapproval signal BUSY-R to accept the request from the R-side processor, when the read/write signal of the L-side processor becomes a logic “1” signal during the end of an operation of writing data “1” in a memory area of the address 1 of the memory 30 according to the request from the L-side processor.
At this time, if the R-side processor immediately performs an operation of “reading data from a memory area of the address 1” at a time period T1 when the R-side processor recognizes that the request disapproval signal BUSY-R changes from an activated state to an inactivated state, unstabilized data are read because the data write operation by the L-side processor is not completely finished, thus causing damage to the data. That is, a data value read from the memory area of address 1 by the R-side processor may be different from real data 1.
Such a conventional problem is more clearly seen in a processor having a fast data access time. Actually, in a processor having a data access time of 10 ns, 20 ns, or 25 ns, data malfunction which cannot be disregarded can be caused by the above-described problem. Therefore, the problem is a subject which must be seriously considered in robot automatic control fields applying a multi-system.